﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace mBlog.Data.Entities
{
    public class Post
    {
        public long Id { get; set; }

        [Column(TypeName="nvarchar")]
        [Required]
        [StringLength(250)]
        public string Title { get; set; }
        
        [Column(TypeName="varchar")]
        [StringLength(250)]
        public string UrlName { get; set; }

        [Column(TypeName="ntext")]
        public string Excerpt { get; set; }
        
        [Column(TypeName="ntext")]
        [Required]
        public string Content { get; set; }

        public DateTime PostedTime { get; set; }
        public DateTime? PublishedTime { get; set; }
        public DateTime? LastUpdatedTime { get; set; }
        public bool IsPublished { get; set; }

        public virtual ICollection<Category> Categories { get; set; }
        public virtual ICollection<Comment> Comments { get; set; }
        public virtual ICollection<Tag> Tags { get; set; }
    }
}